From 31713ab5ef473fec3d90d925a5fbb2ceeb246e3b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 5 Feb 2020 03:12:40 +0100 Subject: [PATCH] stylecontext: Remove gtk_style_context_new() It's private now, no more foreign drawing of any sort. To be fair, it was entirely useless without widget paths already. --- docs/reference/gtk/gtk4-sections.txt | 1 - gtk/gtkstylecontext.c | 33 ---------------------------- gtk/gtkstylecontext.h | 3 --- 3 files changed, 37 deletions(-) diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index a72d0614d9..086f352e4f 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -4801,7 +4801,6 @@ GTK_STYLE_CLASS_WARNING GTK_STYLE_CLASS_WIDE GtkStyleContext -gtk_style_context_new gtk_style_context_add_provider gtk_style_context_add_provider_for_display gtk_style_context_get_parent diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index a5db7066aa..47e96f7ea5 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -68,11 +68,6 @@ * RTL/LTR information set. The style context will also be updated * automatically if any of these settings change on the widget. * - * If you are using the theming layer standalone, you will need to set a - * widget path and a display yourself to the created style context through - * gtk_style_context_set_path() and possibly gtk_style_context_set_display(). - * See the “Foreign drawing“ example in gtk4-demo. - * * # Style Classes # {#gtkstylecontext-classes} * * Widgets can add style classes to their context, which can be used to associate @@ -374,34 +369,6 @@ gtk_style_context_get_node (GtkStyleContext *context) return priv->cssnode; } -/** - * gtk_style_context_new: - * - * Creates a standalone #GtkStyleContext, this style context - * won’t be attached to any widget, so you may want - * to call gtk_style_context_set_path() yourself. - * - * This function is only useful when using the theming layer - * separated from GTK+, if you are using #GtkStyleContext to - * theme #GtkWidgets, use gtk_widget_get_style_context() - * in order to get a style context ready to theme the widget. - * - * Returns: A newly created #GtkStyleContext. - **/ -GtkStyleContext * -gtk_style_context_new (void) -{ - GtkStyleContext *context = g_object_new (GTK_TYPE_STYLE_CONTEXT, NULL); - GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context); - - - /* Create default info store */ - priv->cssnode = gtk_css_node_new (); - gtk_css_node_set_state (priv->cssnode, GTK_STATE_FLAG_DIR_LTR); - - return context; -} - GtkStyleContext * gtk_style_context_new_for_node (GtkCssNode *node) { diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h index 331241d78a..991c7a5a3d 100644 --- a/gtk/gtkstylecontext.h +++ b/gtk/gtkstylecontext.h @@ -849,9 +849,6 @@ struct _GtkStyleContextClass GDK_AVAILABLE_IN_ALL GType gtk_style_context_get_type (void) G_GNUC_CONST; -GDK_AVAILABLE_IN_ALL -GtkStyleContext * gtk_style_context_new (void); - GDK_AVAILABLE_IN_ALL void gtk_style_context_add_provider_for_display (GdkDisplay *display, GtkStyleProvider *provider, -- 2.30.2